<!-- eslint-disable max-len -->
<template>
  <div>
    <div v-for="em in menuNav" :key="em.id">
      <div v-if="em.id == $route.query.id">
        <!-- 头部 -->
        <top-nav>
          <div class="div-top">{{ em.label }}</div>
        </top-nav>
        <!-- 轮播图 -->
        <div>
          <el-carousel height="60vw" class="block-photo">
            <el-carousel-item v-for="e in em.photo" :key="e.id">
              <img class="photo" :src="e.img" alt="" />
            </el-carousel-item>
          </el-carousel>
        </div>
        <div class="box">
          <div class="box-1">
            <span class="span-1">{{ em.label }}</span>
            <span class="span-2">{{ em.money1 }}</span>
          </div>
          <div class="box-2">{{ em.label1 }}</div>
        </div>
        <div class="site">
          <div class="text">
            <img src="../assets/地址555@2x.png" alt="" />
            <div>{{ em.site1 }}</div>
          </div>
          <div class="photo">
            <img src="../assets/电话111@2x.png" alt="" />
          </div>
        </div>
        <div class="buy">
          <div>立即购买</div>
        </div>
        <div class="kongbai"></div>
        <div class="shops">
          <div class="shops-1">商家特色菜</div>
          <div class="shops-2">
            <div v-for="a in em.photo1" :key="a.id">
              <img :src="a.img" alt="" />
            </div>
          </div>
        </div>
        <div class="recommend">
          <div class="qwer">
            <div class="recommend-1">周边推荐</div>
            <div class="recommend-2">
              <button :class="{ a: desc === 'ScenicNav' }" @click="desc = 'ScenicNav'">景区</button>
              <button :class="{ a: desc === 'HotelNav' }" @click="desc = 'HotelNav'">住宿</button>
              <!-- <button :class="{ a: desc === 'FeatureNav' }" @click="desc = 'FeatureNav'">特产</button> -->
              <button :class="{ a: desc === 'FoodNav' }" @click="desc = 'FoodNav'">美食</button>
            </div>
          </div>
          <KeepAlive><component :is="desc"></component></KeepAlive>
        </div>
        <div class="kongbai"></div>
        <div class="bottom">
          <div class="bottom1">
            <div></div>
            <span>图文详情</span>
            <div></div>
          </div>
          <img  class="bottom2" v-for="z in em.photo2" :key="z.id" :src="z.img" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getLocalfeatures } from '@/api/home';
import HotelNav from '@/components/HotelNav.vue';
import FeatureNav from '@/components/FeatureNav.vue';
import ScenicNav from '@/components/ScenicNav.vue';
import FoodNav from '@/components/FoodNav.vue';

export default {
  components: {
    HotelNav,
    FeatureNav,
    ScenicNav,
    FoodNav,
  },
  data() {
    return {
      title: 'FootPage',
      menuNav: [],
      desc: 'ScenicNav',
    };
  },
  created() {
    this.getLocalfeatures();
  },
  methods: {
    async getLocalfeatures() {
      const { data } = await getLocalfeatures();
      this.menuNav = data;
    },
  },
  // components: { FootPage, HotelPage, FeaturePage },
};
</script>

<style lang="scss" scoped>
.photo {
  width: 375px;
  height: 230px;
}
.div-top {
  font-size: 17px;
  color: #333333;
  letter-spacing: 0;
  text-align: center;
  line-height: 44px;
}
.kongbai {
  background: #f5f5f5;
  height: 10px;
}
.box {
  margin: 0 auto;
  margin-top: 20px;
  width: 345px;
  border-bottom: 1px solid #eeeeee;
  .box-1 {
    .span-1 {
      font-size: 22px;
      color: #333333;
    }
    .span-2 {
      font-size: 12px;
      color: #bbbbbb;
    }
  }
  .box-2 {
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #ff416a;
  }
}
.site {
  width: 345px;
  height: 80px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eeeeee;
  .text {
    display: flex;
    height: 40px;
    img {
      width: 15px;
      height: 16px;
    }
    div {
      font-size: 14px;
      color: #333333;
      width: 238px;
      height: 40px;
      margin-left: 10px;
    }
  }
  .photo {
    width: 60px;
    border-left: 1px solid #eeeeee;
    height: 40px;
    line-height: 40px;
    text-align: center;
    img {
      width: 18.5px;
      height: 19.5px;
    }
  }
}
.buy {
  display: flex;
  align-items: center;
  height: 80px;
  margin: 0 auto;
  div {
    width: 345px;
    height: 45px;
    line-height: 45px;
    text-align: center;
    color: #e52f17;
    border: 1px solid;
    border-radius: 4px;
    font-size: 15px;
    color: #e52f17;
  }
}
.shops {
  width: 345px;
  margin: 0 auto;
  overflow: hidden;
  .shops-1 {
    font-size: 17px;
    color: #333333;
    font-weight: bolder;
    height: 40px;
    line-height: 40px;
  }
  .shops-2 {
    display: flex;
    flex-wrap: nowrap;
    div {
      margin-right: 3px;
      img {
        width: 80px;
        height: 54px;
      }
    }
  }
}
.recommend {
  width: 345px;
  margin: 0 auto;
  .qwer {
    border-bottom: 1px solid #eeeeee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    .recommend-1 {
      font-size: 17px;
      color: #333333;
      font-weight: 600;
    }
    .recommend-2 {
      button {
        background: #eeeeee;
        border-radius: 14px;
        border: none;
        margin-left: 10px;
        width: 51px;
        height: 24px;
      }
      .a {
        background-image: linear-gradient(90deg, #ff3840 0%, #ff7b55 99%);
        border-radius: 14px;
        color: #ffffff;
      }
    }
  }
}
.bottom {
  .bottom1 {
    background: #ffffff;
    box-shadow: 0 0 0 0 rgba(238, 238, 238, 0.5);
    width: 345px;
    height: 45px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    div {
      width: 126px;
      height: 1px;
      border-bottom: 1px solid #eeeeee;
    }
    span {
      font-size: 17px;
      color: #333333;
    }
  }
  .bottom2{
    width: 370px;
    height: 250px;
    display: block;
  }
}
</style>
